package NewTablePanels;

import javax.swing.*;

public class NewPassengerclassTable extends JPanel {

	private JPanel leftPart;
	private JPanel rightPart;
	
	private JLabel classIDLabel;
	private JLabel priceLabel;
	private JLabel nameLabel;
	
	private JTextField classIDField;
	private JTextField priceField;
	private JTextField nameField;
	
	public NewPassengerclassTable()
	{
		classIDLabel = new JLabel("Class-ID: ");
		priceLabel = new JLabel("Price: ");
		nameLabel = new JLabel("Name: ");
		
		classIDField = new JTextField(20);
		priceField = new JTextField(20);
		nameField = new JTextField(20);
		
		leftPart = new JPanel();
		rightPart = new JPanel();
		
		leftPart.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
		rightPart.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
		
		fillLeftPart();
		fillRightPart();
		
		this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
		this.add(leftPart);
		this.add(rightPart);
		this.setVisible(false);
	}
	
	private void fillLeftPart()
	{
		leftPart.add(classIDLabel);
		leftPart.add(priceLabel);
		leftPart.add(nameLabel);
	}
	
	private void fillRightPart()
	{
		rightPart.add(classIDField);
		rightPart.add(priceField);
		rightPart.add(nameField);
	}
}
